import React, { Component, useState, useMemo, useEffect, useContext } from "react";
import { ConfigProvider, Button, Col, Form, Input, Row, Select, Space, Dropdown } from "antd";
import {
  RedoOutlined,
  ColumnHeightOutlined,
  SettingOutlined
} from "@ant-design/icons";
import "./style.less";
import { inject, observer, useObserver } from "mobx-react";
import zhCN from "antd/lib/locale/zh_CN";
import PageContext, { CONTEXT_VALUE } from "../../components/pageContainer/PageContext";
import { DownOutlined, SearchOutlined, UpOutlined } from "@ant-design/icons";

const Toolbar = (props) => {
  const { contextValue, setContextValue, handleSearch } = useContext(PageContext); // 数据共享

  const renderToolbar = () => {
    return (
      <Space>
        {props.renderToolbar()}
        <Space>
          <a onClick={handleSearch}><RedoOutlined className={`icon_wrap`} /></a>
          {/*<a><ColumnHeightOutlined className={`icon_wrap`} /></a>*/}
          {/*<a><SettingOutlined className={`icon_wrap`} /></a>*/}
        </Space>
      </Space>
    );
  };

  return (
    <div className="toolbar_wrap">
      <ConfigProvider locale={zhCN}>
        {renderToolbar()}
      </ConfigProvider>
    </div>
  );
};

export default Toolbar;
